package jackson;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.Test;

public class UseJackson {

    /**
     * jackson的String=>Obj 默认String中存在的字段Obj中必须存在
     * @throws Exception
     */
    @Test
    public void test10() throws Exception{
        ObjectMapper om = new ObjectMapper();
        Person person = om.readValue("{\"name\":\"lujieni\",\"age\":30}", Person.class);
    }

}

class Person{

    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
